import Home from "../views/Home.vue";
import Layout from "../layout/user/Layout.vue";
import AdminLogin from "../views/admin/AdminLogin.vue";
import AdminRegister from "../views/admin/AdminRegister.vue";
import UserLogin from "../views/user/UserLogin.vue";
import UserRegister from "../views/user/UserRegister.vue";
import UserList from "../views/user/UserList.vue";
import ResetPass from "../views/user/UserResetPass.vue";
import UserDetail from "../views/user/UserDetail.vue";
import DocumentPreview from "../views/document/DocumentPreview.vue";
import DocumentUpload from "../views/document/DocumentUpload.vue";
import DocumentEdit from "../views/document/DocumentEdit.vue";
import UserDocuments from "../views/document/UserDocuments.vue";
import SearchDocuments from "../views/document/SearchDocuments.vue";
import DocumentList from "../views/document/DocumentList.vue";
import AdminHome from "../views/admin/AdminHome.vue";
import AdminLayout from "../layout/admin/AdminLayout.vue";
import UserChangePass from "../views/user/UserChangePass.vue";
import SensitiveWordList from "../views/sensitiveWord/SensitiveWordList.vue";
import AddSensitiveWord from "../views/sensitiveWord/AddSensitiveWord.vue";


const routes = [
    {
        path: '/',
        component: Layout,
        children: [
            {path: '/', component: Home},
            //--------<User>--------
            {
                path: '/user',
                children: [
                    {path: 'list', component: UserList},
                    {path: 'detail', component: UserDetail},
                    {path: 'changePass', component: UserChangePass},
                ]
            },
            //--------<Document>--------
            {
                path: '/document',
                children: [
                    {path: 'upload', component: DocumentUpload},
                    {path: 'edit/:documentId(\\d+)', component: DocumentEdit},
                    {path: 'user/:userId(\\d+)', component: UserDocuments},
                    {path: 'search', component: SearchDocuments},
                ]
            },
        ]
    },
    //--------<Admin>--------
    {
        path: '/admin',
        component: AdminLayout,
        children: [
            {path: '/admin', component: AdminHome},
            {
                path: 'user',
                children: [
                    {path: 'list', component: UserList}
                ]
            },
            {
                path: 'document',
                children: [
                    {path: 'list', component: DocumentList}
                ]
            },

            //---------------------<SensitiveWorld>-------------------------
            {
                path: 'sensitiveWord',
                children: [
                    { path:'sensitiveWordList' ,component: SensitiveWordList },
                    { path:'addSensitiveWord' ,component: AddSensitiveWord },
                ]
            },
        ]
    },
    //--------<User>--------
    {
        path: '/user',
        children: [
            {path: 'login', component: UserLogin,},
            {path: 'register', component: UserRegister,},
            {path: 'resetPass', component: ResetPass}
        ]
    },
    //--------<document>--------
    {
        path: '/document',
        children: [
            {path: 'preview/:documentId', component: DocumentPreview},
        ]
    },
    //--------<admin>--------
    {
        path: '/admin',
        children: [
            {path: 'login', component: AdminLogin},
            {path: 'register', component: AdminRegister},
        ]
    }
]
export default routes
